/*
 * ImageView.java
 *
 * Created on 25 Февраль 2007 г., 5:33
 *
 * @author ipse
 *
 */

package ui;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import locale.SR;

public class ImageView implements CommandListener {
    
    private Form formIv;
    private Image imageIv;
    private Display display;
    protected Displayable next;
    private Command backIv;
    
    
    public void commandAction(Command c, Displayable d) {
        if (c == backIv) {
            display.setCurrent(next);
            formIv.delete(0);
        }
    }
    /** Creates a new instance of ImageView */
    public ImageView(String title, String text, Image image, Display display, Displayable nextDisplayable) {
        this.display=display;
        next=(nextDisplayable==null)? display.getCurrent() : nextDisplayable;
        formIv = new Form(null);
        formIv.setCommandListener(this);
        backIv = new Command(SR.MS_BACK, Command.BACK, 1);
        formIv.addCommand(backIv);
        formIv.append(image);
        formIv.append(text);
        display.setCurrent(formIv);
    }
        
}
